/*  
    Copyright (C) <2013>  <jjchen.lian@gmail.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _ENGINE_H
#define _ENGINE_H

#include "fdevent.h"
#include "double_link_list.h"

#define INVALID_ENGINE NULL
#define MAXFD 1024

typedef struct engine {
	fdevents * _fdevents;
    struct double_link_list * socket_actived_list;
	void  (*engine_server_work)(); //游戏引擎初始化
    fdevents * (*engine_fdevent_init)(); //游戏网关事件的初始化
	void (*engine_epoll_loop)(); //游戏引擎循环
    void (*engine_fdevent_free)();
	//void (*engine_fdevents_register)();
	//void (*engine_fdevents_unregister)();
}engine_t;

engine_t * create_engine();
void	free_engine(engine_t * e);
engine_t *	init_engine(engine_t * e);
void	start_engine(engine_t * e);
engine_t *  malloc_engine();

#endif